package com.excel.write;

import com.excel.entity.CCell;

import java.util.LinkedList;
import java.util.List;

public class CHead {
    private List<CCell> headers = new LinkedList<>();

    public List<CCell> getHeaders() {
        return headers;
    }

    public void setHeaders(List<CCell> headers) {
        this.headers = headers;
    }


    public static final class CHeadBuilder {
        private CHead cHead;
        private List<CCell> headers;

        private CHeadBuilder() {
            headers = new LinkedList<>();
            cHead = new CHead();
        }

        public static CHeadBuilder aCHead() {
            return new CHeadBuilder();
        }

        public CHeadBuilder add(CCell cCell) {
            headers.add(cCell);
            return this;
        }

        public CHead build() {
            cHead.setHeaders(headers);
            return cHead;
        }
    }
}
